﻿using System.ComponentModel.DataAnnotations;

namespace KL.UFrame.Data.Models
{
    public class AccountInfoModel
    {
         public string UserId { get; set; }

        public string UserName { get; set; }

        public string RealName { get; set; }

        public string Phone { get; set; }

        public string  Email { get; set; }
        public string HeadImageUrl { get; set; }

        public string[] Roles { get; set; }
    }

    public class ChangePasswordBindingModel
    {
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "当前密码")]
        public string OldPassword { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "{0} 必须至少包含 {2} 个字符。", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "新密码")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "确认新密码")]
        [Compare("NewPassword", ErrorMessage = "新密码和确认密码不匹配。")]
        public string ConfirmPassword { get; set; }
    }
    public class SetPasswordBindingModel
    {
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(100, ErrorMessage = "{0} 必须至少包含 {2} 个字符。", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "新密码")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "确认新密码")]
        [Compare("NewPassword", ErrorMessage = "新密码和确认密码不匹配。")]
        public string ConfirmPassword { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [DataType(DataType.PhoneNumber)]
        [Display(Name = "手机号")]
        public string Phone { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "验证码")]
        public string Code { get; set; }
    }

    public class RoleModel
    {
        public string Id { get; set; }
        public string Name { get; set; }
    }
}